﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Trabajador
{
    public partial class ModificarTrabajador : Form
    {
        public ModificarTrabajador()
        {
            InitializeComponent();
        }

        private void ModificarTrabajador_Load(object sender, EventArgs e)
        {
           
            radioButton12.Select();
            radioButton10.Select();
            radioButton8.Select();
            casado.Select();
            masculino.Select();
            /*txtName.Enabled = false;
            txtName.ReadOnly = true;
            txtScdName.Enabled = false;
            txtScdName.ReadOnly = true;
             * */
           // this.IsMdiContainer = true;
            
        }


        private void btnSearch_Click(object sender, EventArgs e)
        {

            Busqueda search = new Busqueda(); 
            search.Show();
            /*
             * UpdateForm upForm = new UpdateForm(resultBox.SelectedItems[0].Text,            dbdirec, dbfname);
                upForm.ShowDialog(this);
             */
        }

        private void comboPensionario_SelectedIndexChanged(object sender, EventArgs e)
        {
             
            txtCuspp.Enabled = true;
            txtCuspp.ReadOnly = false;
            textBox30.Enabled = true;
            textBox30.ReadOnly = false;
            textBox31.Enabled = true;
            textBox31.ReadOnly = false;
            textBox32.Enabled = true;
            textBox32.ReadOnly = false;
            textBox33.Enabled = true;
            textBox33.ReadOnly = false;
            textBox34.Enabled = true;
            textBox34.ReadOnly = false;
            textBox35.Enabled = true;
            textBox35.ReadOnly = false;
        
        }

        private void comboSalud_SelectedIndexChanged(object sender, EventArgs e)
        {
            textBox24.Enabled = true;
            textBox24.ReadOnly = false;
            textBox25.Enabled = true;
            textBox25.ReadOnly = false;
            textBox26.Enabled = true;
            textBox26.ReadOnly = false;
            textBox27.Enabled = true;
            textBox27.ReadOnly = false;
            textBox28.Enabled = true;
            textBox28.ReadOnly = false;
            textBox29.Enabled = true;
            textBox29.ReadOnly = false;
        }

        private void comboDoc_SelectedIndexChanged(object sender, EventArgs e)
        {
            txtNumDoc.Enabled = true;
            txtNumDoc.ReadOnly = false;
        }

        private void radioButton11_CheckedChanged(object sender, EventArgs e)
        {
            
            if (radioButton11.Checked == true)
            {
                textBox18.Enabled = true;
                textBox18.ReadOnly = false;
                textBox19.Enabled = true;
                textBox19.ReadOnly = false;
                textBox20.Enabled = true;
                textBox20.ReadOnly = false;
                textBox21.Enabled = true;
                textBox21.ReadOnly = false;
                textBox22.Enabled = true;
                textBox22.ReadOnly = false;
                textBox23.Enabled = true;
                textBox23.ReadOnly = false;
            }
        }


        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Are you sure you want to modify this item?", "Confirm Modification", MessageBoxButtons.YesNo) == DialogResult.Yes)
            { // a 'DialogResult.Yes' value was returned from the MessageBox // proceed with your deletion +
                MessageBox.Show("Trabajador Modificado");
            }
        }

       
    }
}
